<!DOCTYPE html>
<html>
<head> 
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>爱家-房间信息</title>
    <link href="/static/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="/static/css/reset.css" rel="stylesheet">
    <link href="/static/plugins/swiper/css/swiper.min.css" rel="stylesheet">
    <link href="/static/plugins/bootstrap-datepicker/css/bootstrap-datepicker.min.css" rel="stylesheet">
    <link href="/static/css/ihome/main.css" rel="stylesheet">
    <link href="/static/css/ihome/detail.css" rel="stylesheet">
</head>
<body>
    <div class="container">
        <div class="top-bar">
            <div class="nav-bar">
                <h3 class="page-title">房间信息</h3>
                <!--<a class="nav-btn fl" href="{% url 'my:my_house' %}" onclick="hrefBack();"><span><i class="fa fa-angle-left fa-2x"></i></span></a>-->
                <a class="nav-btn fl" onclick="hrefBack();"><span><i class="fa fa-angle-left fa-2x"></i></span></a>
            </div>
        </div>
        <div class="swiper-container">
            <ul class="swiper-wrapper">
                {% for house_image in house.house_image.all %}
                <li class="swiper-slide"><img src="/media/{{ house_image.url }}"></li>
                {% endfor %}
                <!--<li class="swiper-slide"><img src="/static/images/home02.jpg"></li>-->
                <!--<li class="swiper-slide"><img src="/static/images/home03.jpg"></li>-->
            </ul>
            <div class="swiper-pagination"></div>
            <div class="house-price">￥<span>{{ house.price }}</span>/晚</div>
        </div>
        <div class="detail-con">
            <div class="detail-header layout-style">
                <h2 class="house-title">{{ house.title }}</h2>
                <div class="landlord-pic"><img src="/media/{{ house.user_h.user_profile.avatar }}/"></div>
                <h2 class="landlord-name">房东： <span>{{ house.user_h.user_profile.name }}</span></h2>
            </div>
            <div class="house-info layout-style">
               <h3>{{ house.area_h.name }}</h3>
               <ul class="house-info-list text-center">
                    <li>{{ house.address }}</li>
               </ul>
            </div>
            <ul class="house-type layout-style">
                <li>
                    <span class="icon-house"></span>
                    <div class="icon-text">
                        <h3>出租{{ house.room_count }}间</h3>
                        <p>房屋面积:{{ house.acreage }}平米</p>
                        <p>房屋户型:{{ house.unit }}</p>
                    </div>
                </li>
                <li>
                    <span class="icon-user"></span>
                    <div class="icon-text">
                        <h3>宜住{{ house.capacity }}人</h3>
                    </div>
                </li>
                <li>
                    <span class="icon-bed"></span>
                    <div class="icon-text">
                        <h3>卧床配置</h3>
                        <p>{{ house.beds }}</p>
                    </div>
                </li>
            </ul> 
            <div class="house-info layout-style">
                <h3>房间详情</h3>
                <ul class="house-info-list">
                    <li>收取押金<span>{{ house.deposit }}</span></li>
                    <li>最少入住天数<span>{{ house.min_days }}</span></li>
                    <li>最多入住天数<span>
                        {% ifequal house.max_days 0 %}不限制天数{% else %}{{ house.max_days }}{% endifequal %}
                    </span></li>
                </ul>
            </div>
            <div class="house-facility layout-style">
                <h3>配套设施</h3>
                <ul class="house-facility-list clearfix">
                    {% for facility in house.facility.all %}
                        <li><span class="{{ facility.css }}"></span>{{ facility.name }}</li>
                    {% endfor %}

                </ul>
            </div> 
            <div class="house-info layout-style">
                <h3 style="margin-bottom: 10px">评价信息</h3>
                <ul class="house-comment-list">
                    {% for order in house.order_set.all %}
                    {% if order.status == "COMPLETE" %}
                        <li>
                            <p>{{ order.user_order.user_profile.name }}<span class="fr">{{ order.update_time }}</span></p>
                            <p>{{ order.comment }}</p>
                        </li>
                    {% endif %}
                    {% endfor %}
                </ul>
            </div>
        </div>
        {% if house.user_h != user %}
        <a class="book-house" href="{% url 'house:booking' house.id %}">即刻预定</a>
        {% endif %}
        <div class="footer">
            <p><span><i class="fa fa-copyright"></i></span>爱家租房&nbsp;&nbsp;享受家的温馨</p>
        </div>
    </div>
    
    <script src="/static/js/jquery.min.js"></script>
    <script src="/static/plugins/bootstrap/js/bootstrap.min.js"></script>
    <script src="/static/plugins/swiper/js/swiper.jquery.min.js"></script>
    <script src="/static/plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script>
    <script src="/static/plugins/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
    <script src="/static/js/template.js"></script>
    <script src="/static/js/ihome/detail.js"></script>
</body>
</html>